import request from '@/utils/request'
import fileRequest from '@/utils/file'





export function selectAmmunitionByIdApi(params) {
  //此处直接使用参数
  return request({
    url: '/ammunition/selectAmmunitionById',
    method: 'GET',
    params
  })
}
export function getAmmunitionListApi(params) {
  //此处直接使用参数
  return request({
    url: '/ammunition/getAmmunitionList',
    method: 'GET',
    params
  })
}

export function deleteAmmunitionApi(params){
  return request({
    url:'/ammunition/deleteAmmunition',
    method:'GET',
    params
  })
}
export function insertAndUpdateAmmunitionAip(data) {
  return request({
    url: '/ammunition/insertAndUpdateAmmunition',
    method: 'POST',
    data: data
  })
}
export function getDropListApi(params){
  return request({
    url:'/ammunition/getDropList',
    method:'GET',
    params
  })
}

/**
 * 弹药检测数量统计导出
 * @param data
 * @returns {*}
 */
export function exportRoster(data) {
  return fileRequest({
    url: '/excel/exportAmmunitionExcel',
    method: 'POST',
    data: data,
    responseType:'blob'
  })
}

/**
 * 文件导入
 * @param data
 */
export function doImport(data) {
  return request({
    url: '/import/importAmmunition',
    method: 'POST',
    data
  })
}


export function deleteAmmunitionBatchByIds(params) {
  return request({
    url: '/ammunition/deleteAmmunitionBatchByIds',
    method: 'DELETE',
    params,
  });
}
